package cn.kgc.spring.day04.statik;

import cn.kgc.spring.day04.service.TeacherService;
import cn.kgc.spring.day04.service.impl.TeacherServiceImpl;

/**
 * @author 课工场
 * @date 2024/7/16
 * @description   该类是 TeacherServiceImpl类的代理类
 *  代理类中只编写增强的业务  基础的业务还是有被代理对象完成
 */
public class TeacherServiceStaticProxy implements TeacherService {

    private TeacherService teacherService = new TeacherServiceImpl();

    @Override
    public String techOnline(String course) {

        System.out.println("----上课时间到了,请开始上课----");

        String s = teacherService.techOnline(course);

        System.out.println("----下课时间到了,请准时下课----");

        return s;
    }

    @Override
    public String techOffline(String course) {

        System.out.println("----上课时间到了,请开始上课----");

        String s = teacherService.techOffline(course);

        System.out.println("----下课时间到了,请准时下课----");
        return s;
    }
}
